import { stringify } from 'qs';
import request from '@/utils/request';
import { paramsToFormData } from '@/utils/utils';

export async function accountLogin(params) {
  delete params.type;

  return request('/api/user/login', {
    method: 'POST',
    body: paramsToFormData(params),
  });
}

export async function logout() {
  return request('/api/user/logout', {
    method: 'POST',
  });
}